package com.example.show2page.controller.config;

import com.example.show2page.controller.PageController;
import com.example.show2page.pojo.ResultVo;
import com.example.show2page.utils.ResultVoUtil;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Hacah
 * @date 2021/4/25 11:27
 *
 * 异常处理类
 */
@ControllerAdvice()
public class AppExceptionHandlerAdvice {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public ResultVo defaultError(Exception e) {
        e.printStackTrace();
        return ResultVoUtil.error("错误");
    }
}
